package com.baseLearn.learn.arithmetic.BTree;

import java.util.List;

/**
 * 给定一个二叉树,返回它的中序遍历
 * 例:一个二叉树
 * 1
 * \
 * 2
 * /
 * 3
 * <p>
 * 返回 1,3,2
 */
public class BTreeBehind {

    public static void main(String[] args) {
//        List<Integer> orders = new ArrayList<Integer>();
//        order(root, orders);
    }

    public static void order(TreeNode root, List<Integer> orders) {
        if (root.getLeft() != null) {
            order(root.getLeft(), orders);
        }
        orders.add(root.getValue());
        if (root.getRight() != null) {
            order(root.getRight(), orders);
        }
    }
}
